<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery.min.js"></script>
</head>
<body>
   <div class="yeye">
   <div class="baba">
   <div class="erzi">儿子</div>
   </div>
   </div>
   <div class="nav">
       <p>我是p元素</p>
       <div>
           <p>我是下p</p>
       </div>
   </div>
   <script>
       $(function () {
           //1.找erzi这个元素的最近一级父级元素
           console.log($(".erzi").parent());
           //2.找class=“nav”的最近一级的子元素并设置字体颜色  children()--找所又的子元素
           console.log( $(".nav").children("p"));
           $(".nav").children("p").css("color","red");

       })
   </script>
</body>
</html>